<template>
  <div id="app">
    <router-view :key="$route.fullPath"/>
  </div>
</template>

<script>
export default {
  name: 'App',
  created () {
  },
  mounted () {
    const handler = () => {
      this.$store.commit('updateSize', {
        width: document.documentElement.clientWidth,
        height: document.documentElement.clientHeight
      })
    }
    handler()
    window.addEventListener('resize', handler)
    this.$once('hook:beforeDestroy', () => {
      window.removeEventListener('resize', handler)
    })
  }
}
</script>